DATABASES = {
    'default': {
        'ATOMIC_REQUESTS': True,
        'ENGINE': 'awx.main.db.profiled_pg',
        'NAME': "{{ awx_postgres_database }}",
        'USER': "{{ awx_postgres_user }}",
        'PASSWORD': "{{ awx_postgres_pass }}",
        'HOST': '{{ awx_postgres_host }}',
        'PORT': "{{ awx_postgres_port }}",
        'OPTIONS': { 'sslmode': '{{ awx_postgres_sslmode }}',
{% if awx_postgres_sslmode in ['verify-ca', 'verify-full'] %}
                     'sslrootcert': '{{ ca_trust_bundle }}',
{% endif %}
{% if awx_postgres_target_session_attrs %}
                     'target_session_attrs': '{{ awx_postgres_target_session_attrs }}',
{% endif %}
        },
    }
}

LISTENER_DATABASES = {
    'default': {
        'OPTIONS': {
{% if postgres_keepalives %}
            'keepalives': 1,
            'keepalives_idle': {{ postgres_keepalives_idle }},
            'keepalives_interval': {{ postgres_keepalives_interval }},
            'keepalives_count': {{ postgres_keepalives_count }},
{% else %}
            'keepalives': 0,
{% endif %}
{% if awx_postgres_target_session_attrs %}
            'target_session_attrs': '{{ awx_postgres_target_session_attrs }}',
{% endif %}
        },
    }
}

BROADCAST_WEBSOCKET_SECRET = "{{ broadcast_websocket_secret_value }}"
